package com.openlogic.logic.controller.logic;

import java.util.List;
import java.util.Map;

import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Get;
import org.noear.solon.annotation.Inject;
import org.noear.solon.annotation.Mapping;
import org.noear.solon.annotation.Param;
import org.noear.solon.auth.annotation.AuthPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.mybatisflex.core.paginate.Page;
import com.openlogic.api.logic.entity.RuleExecLog;
import com.openlogic.common.core.enums.BusinessType;
import com.openlogic.common.core.web.controller.BaseController;
import com.openlogic.common.core.web.domain.PageData;
import com.openlogic.common.datasource.annotation.QzLog;
import com.openlogic.logic.service.logic.RuleExecLogService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * @ClassName: RuleExecLogController
 * @Description: 决策执行日志Controller
 * @author weiyongpeng
 * @date 2024年7月22日 下午3:45:05
 */
@Api(value = "决策执行日志管理API")
@Controller
@Mapping("rule/log")
public class RuleExecLogController extends BaseController {

	private static final Logger logger = LoggerFactory.getLogger(RuleExecLogController.class);

	@Inject
	private RuleExecLogService ruleExecLogService;

	/**
	 * 描述：根据参数查询规制执行日志列表
	 * @Title: listLog
	 * @param params
	 * @return
	 * @author weiyongpeng
	 * @date 2024年7月23日 下午1:57:27
	 */
	@ApiOperation(value = "决策执行日志查询")
	@Get
	@Mapping("listLog")
	@AuthPermissions("rule:log:list")
	@QzLog(title = "决策执行日志查询", businessType = BusinessType.LIST)
	public PageData<RuleExecLog> listLog(Page<RuleExecLog> page, @Param Map<String, Object> params) {
		logger.info("决策日志开始查询...");
		startPage(page);
		List<RuleExecLog> list = ruleExecLogService.findRuleLogList(params);
		return getPageData(list);
	}

}
